home *** CD-ROM | disk | FTP | other *** search
/ Turnbull China Bikeride / Turnbull China Bikeride - Disc 2.iso / STUTTGART / LANG / ADA / GNAT / !gcc / adainc / 6 / ads / s-taspda < prev    next >
Text File  |  1996-02-12  |  6KB  |  115 lines

  1. ------------------------------------------------------------------------------
  2. --                                                                          --
  3. --                         GNAT COMPILER COMPONENTS                         --
  4. --                                                                          --
  5. --            S Y S T E M . T A S K _ S P E C I F I C _ D A T A             --
  6. --                                                                          --
  7. --                                 S p e c                                  --
  8. --                                                                          --
  9. --                            $Revision: 1.10 $                             --
  10. --                                                                          --
  11. --     Copyright (C) 1992,1993,1994,1995 Free Software Foundation, Inc.     --
  12. --                                                                          --
  13. -- GNAT is free software;  you can  redistribute it  and/or modify it under --
  14. -- terms of the  GNU General Public License as published  by the Free Soft- --
  15. -- ware  Foundation;  either version 2,  or (at your option) any later ver- --
  16. -- sion.  GNAT is distributed in the hope that it will be useful, but WITH- --
  17. -- OUT ANY WARRANTY;  without even the  implied warranty of MERCHANTABILITY --
  18. -- or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License --
  19. -- for  more details.  You should have  received  a copy of the GNU General --
  20. -- Public License  distributed with GNAT;  see file COPYING.  If not, write --
  21. -- to  the Free Software Foundation,  59 Temple Place - Suite 330,  Boston, --
  22. -- MA 02111-1307, USA.                                                      --
  23. --                                                                          --
  24. -- As a special exception,  if other files  instantiate  generics from this --
  25. -- unit, or you link  this unit with other files  to produce an executable, --
  26. -- this  unit  does not  by itself cause  the resulting  executable  to  be --
  27. -- covered  by the  GNU  General  Public  License.  This exception does not --
  28. -- however invalidate  any other reasons why  the executable file  might be --
  29. -- covered by the  GNU Public License.                                      --
  30. --                                                                          --
  31. -- GNAT was originally developed  by the GNAT team at  New York University. --
  32. -- It is now maintained by Ada Core Technologies Inc (http://www.gnat.com). --
  33. --                                                                          --
  34. ------------------------------------------------------------------------------
  35.  
  36. --  This package contains an interface for manipulation of task specific data
  37.  
  38. package System.Task_Specific_Data is
  39.  
  40.    --  Here we define a single type that encapsulates the various task
  41.    --  specific data. This type is used to store the necessary data into
  42.    --  the Task_Control_Block.
  43.  
  44.    type TSD is
  45.       record
  46.          Jmpbuf_Address : Address;
  47.          GNAT_Exception : Address;
  48.          Sec_Stack_Addr : Address;
  49.          Exc_Stack_Addr : Address;
  50.          Message_Length : Natural;
  51.          Message_Addr   : Address;
  52.       end record;
  53.  
  54.    --  This package just re-exports the Get/Set routines for the various
  55.    --  Task Specific Data (TSD) elements from System.Tasking_Soft_Links,
  56.    --  but as callable subprograms instead of objects of access to
  57.    --  subprogram types.
  58.  
  59.    function  Get_Jmpbuf_Address return  Address;
  60.    procedure Set_Jmpbuf_Address (Addr : Address);
  61.    pragma Inline (Get_Jmpbuf_Address);
  62.    pragma Inline (Set_Jmpbuf_Address);
  63.    --  These routines provide a task specific address used to store the
  64.    --  address of the current longjmp/setjmp jump buffer for exception
  65.    --  management (under the current scheme which uses longjmp/setjmp)
  66.  
  67.    function  Get_GNAT_Exception return  Address;
  68.    procedure Set_GNAT_Exception (Addr : Address);
  69.    pragma Inline (Get_GNAT_Exception);
  70.    pragma Inline (Set_GNAT_Exception);
  71.    --  These routines provide a task specific address used to temporarily
  72.    --  store the address of the current exception during propagation.
  73.  
  74.    function  Get_Sec_Stack_Addr return  Address;
  75.    procedure Set_Sec_Stack_Addr (Addr : Address);
  76.    pragma Inline (Get_Sec_Stack_Addr);
  77.    pragma Inline (Set_Sec_Stack_Addr);
  78.    --  These routines provide a task specific address used to reference
  79.    --  the currently allocated secondary stack.
  80.  
  81.    function  Get_Exc_Stack_Addr return Address;
  82.    procedure Set_Exc_Stack_Addr (Addr : Address);
  83.    pragma Inline (Get_Exc_Stack_Addr);
  84.    pragma Inline (Set_Exc_Stack_Addr);
  85.    --  These routines provide the address of a task-specific stack used
  86.    --  for the propagation of exceptions in response to synchronous faults.
  87.    --  This alternate stack is necessary when propagating Storage_Error
  88.    --  resulting from a stack overflow, as the task's primary stack is
  89.    --  exhausted. Non-SGI platforms may implement these as dummy bodies.
  90.  
  91.    function  Get_Message_Length return Natural;
  92.    procedure Set_Message_Length (Len : Natural);
  93.    pragma Inline (Get_Message_Length);
  94.    pragma Inline (Set_Message_Length);
  95.    --  These routines provide access to the length of the currently raised
  96.    --  exception's message. O means no message.
  97.  
  98.    function  Get_Message_Addr return Address;
  99.    procedure Set_Message_Addr (Addr : Address);
  100.    pragma Inline (Get_Message_Addr);
  101.    pragma Inline (Set_Message_Addr);
  102.    --  These routines provide access to the buffer containing the currently
  103.    --  raised exception's message. The actual message is:
  104.    --    To_Big_String_Ptr (Get_Message_Addr).all (1 .. Get_Message_Length)
  105.  
  106.    procedure Create_TSD (New_TSD : in out TSD);
  107.    --  Called from s-tassta when a new thread is created to perform
  108.    --  any required initialization of the TSD.
  109.  
  110.    procedure Destroy_TSD (Old_TSD : in out TSD);
  111.    --  Called from s-tassta  just before a thread is destroyed to perform
  112.    --  any required finalization.
  113.  
  114. end System.Task_Specific_Data;
  115.